package com.lovo.pz.role;

import java.awt.Component;
import java.awt.Graphics;

/**
 * 所有角色的父类
 */
public abstract class BaseRole {
	/** 角色正常运行的状态值 */
	public static final int NORMAL = 0;
	/** 角色消失的状态值 */
	public static final int ROLE_END = 1;
	/** 游戏开始状态 */
	public static final int GAME_START = 2;
	/** 游戏结束状态 */
	public static final int GAME_END = 3;
	/** 太阳种子被点击后移动的状态 */
	public static final int SEED_MOVE = 4;
	/** 发射子弹的状态 */
	public static final int SEND_BULLET = 5;
	/** 植物的阴影状态 */
	public static final int PLANT_TEMP = 6;
	/** 铲子被选中的状态 */
	public static final int SHOVEL_SELECTED = 7;
	/** 爆炸的状态 */
	public static final int BOM = 8;
	/** 汽车移动的状态 */
	public static final int CAR_RUN = 9;
	/** 游戏准备的状态 */
	public static final int GAME_READY = 10;
	/** 游戏安放的状态 */
	public static final int GAME_SET = 11;
	/** 安放植物的状态 */
	public static final int GAME_PLANT = 12;
	/** 僵尸胜利的状态 */
	public static final int GAME_ZOMBIE_WON = 13;
	/** 植物卡片可用的状态 */
	public static final int CARD_ENABLED = 14;
	/** 植物卡片不可用的状态 */
	public static final int CARD_DISABLED = 15;
	/** 一大波僵尸来临的状态 */
	public static final int MORE_ZOMBIE_COME = 16;
	/** 角色的X坐标 */
	private int roleX;
	/** 角色的Y坐标 */
	private int roleY;
	/** 角色的宽 */
	private int roleWidth;
	/** 角色的高 */
	private int roleHeight;
	/** 角色的运行状态 */
	private int runStatus;
	/** 角色每次移动的距离 */
	private int moveLength;
	/** 角色HP值 */
	private int hp;
	/** 植物花费的种子数 */
	private int cost;
	private Component component;
	public BaseRole(Component component){
		this.component = component;
		initRole();
	}
	/**
	 * 初始化角色属性
	 */
	public abstract void initRole();

	/**
	 * 绘制角色
	 * @param g
	 */
	public abstract void paintRole(Graphics g);

	/**
	 * 角色执行的动作
	 */
	public abstract void action();

	public int getRoleX() {
		return roleX;
	}
	public void setRoleX(int roleX) {
		this.roleX = roleX;
	}
	public int getRoleY() {
		return roleY;
	}
	public void setRoleY(int roleY) {
		this.roleY = roleY;
	}
	public int getRoleWidth() {
		return roleWidth;
	}
	public void setRoleWidth(int roleWidth) {
		this.roleWidth = roleWidth;
	}
	public int getRoleHeight() {
		return roleHeight;
	}
	public void setRoleHeight(int roleHeight) {
		this.roleHeight = roleHeight;
	}
	public int getRunStatus() {
		return runStatus;
	}
	public void setRunStatus(int runStatus) {
		this.runStatus = runStatus;
	}
	public int getMoveLength() {
		return moveLength;
	}
	public void setMoveLength(int moveLength) {
		this.moveLength = moveLength;
	}
	public Component getComponent() {
		return component;
	}
	public void setComponent(Component component) {
		this.component = component;
	}
	public int getHp() {
		return hp;
	}
	public void setHp(int hp) {
		this.hp = hp;
	}

	public int getCost() {
		return cost;
	}

	public void setCost(int cost) {
		this.cost = cost;
	}
}
